home *** CD-ROM | disk | FTP | other *** search
/ Utilities Professional 1-1500 / Utilities Professional 1-1500 (1994)(WPD)[!].iso / 12511500 / var1353.dms / var1353.adf / TEXTPLUS / TPP501.lha / TPP / Rexx / ShowLogfile.tpl < prev    next >
Text File  |  1994-01-06  |  2KB  |  82 lines

  1. /* Show Logfile - Macro */
  2. /* Kick 2.0 only */
  3.  
  4. options results
  5.  
  6. binary='C:Type'
  7. /* output='>"CON:0/16/700/440/Show Logfile/AUTO/WAIT/ALT/INACTIVE/SCREENTextPlus"' */
  8. hailstring='Show Logfile'
  9.  
  10. address 'TextPlus'
  11.  
  12. /* get name of current file */
  13. 'GetName'
  14. filename = result
  15.  
  16. /* get screen name */
  17. 'GetScreenName'
  18. pub_name = result
  19.  
  20. /* left edge */
  21. 'GetWindowLeftEdge'
  22. le = result
  23. /* top edge */
  24. 'GetWindowTopEdge'
  25. te = result
  26. /* width */
  27. 'GetWindowWidth'
  28. wi = result
  29. /* height */
  30. 'GetWindowHeight'
  31. he = result
  32.  
  33. output = '>"CON:'||le||'/'||te||'/'||wi||'/'||he||'/'||hailstring||'/AUTO/WAIT/ALT/INACTIVE/SCREEN'||pub_name||'"'
  34.  
  35. /* strip off extension */
  36. if RIGHT(filename, 4) == '.tex' | RIGHT(filename, 4) == '.tpp' then do
  37.    len = LENGTH(filename) - 4
  38.    filename = LEFT(filename, len)
  39.    end
  40.  
  41. 'RequestString' hailstring'\\'filename
  42. showopts = result
  43.  
  44. n = WORDS(showopts)
  45. fullname = WORD(showopts, n)
  46. n = LENGTH(showopts) - LENGTH(fullname)
  47. printopts = LEFT(showopts, n)
  48.  
  49. PARSE VALUE namestruc(fullname) WITH ivol idirs ibase .
  50.  
  51. IF fullname == "" then empty = 'true'
  52.                   else empty = 'false'
  53.  
  54. IF "" == SUBSTR(fullname, 1+ivol+idirs+ibase) THEN DO
  55.         fullname = fullname||".log"     /* supply a default extension   */
  56.         ibase = ibase + 4
  57.         END
  58.  
  59. IF 0 = ivol THEN DO
  60.         direc = PRAGMA('d')
  61.         IF RIGHT(direc,1)~='/' & RIGHT(direc,1)~=':' THEN direc=direc||'/'
  62.         fullname = direc||fullname
  63.         DROP direc
  64.         END
  65. ELSE DO
  66.         direc = SUBSTR(fullname, 1, ivol+idirs)
  67.         IF RIGHT(direc,1) = '/' THEN DO
  68.             n = LENGTH(direc)
  69.             direc = LEFT(direc, n-1)
  70.             END
  71.         call pragma 'Directory', direc
  72.      END
  73. DROP ivol idirs ibase
  74.  
  75. /* valid filename ? */
  76. if empty = 'false' then do
  77.    address command binary output fullname
  78.    end
  79. else
  80.    'Display' 'Show Logfile --- Aborted'
  81.  
  82.